# -* - coding: UTF-8 -* -
#import sys 
#reload(sys)
#sys.setdefaultencoding('utf8')

#客户端抽像类
class ClientDriver():  
	def __init__(self,config): 
		self.config=config
		self.create()
	def create(self):  
		pass	
	def send(body):
		pass
	
	


#队列驱动抽像类
class QueueDriver():  
	def __init__(self,config,name): 
		self.config=config
		self.queue_name=name
	def create(self):  
		pass	
	def listen(self,on_request):
		self.create()
		pass
	def stop(self):  
		pass			
	def send(self,body,args={}):
		pass
	
	
#对列状态持久化抽像类
class DurableDriver():  
	def __init__(self,config): 
		self.config=config
		self.create()
	def __del__(self):
		self.destory()
	#*
	# 此任务是否支持序列化
	# @param command
	# @param data
	# @return Task
	#/
	def check(self,task):
		return task and ((task.plan=='loop_delay') or (task.plan=='at'))
	#*
	# 创建
	# @return Task	
	def create(self):  
		pass
	def destory(self):  
		pass		
	#*
	# 写入
	# @param command
	# @param data
	# @return Task
	def write(self,task):
		pass
	#*
	# 读取任务状态
	# @param uuid
	#/		
	def read(self,uuid):
		pass
	
	#*
	# 更新执行状态
	# @param uuid
	# @param status
	#/
	def update(self,uuid,status):
		pass
